package com.jc.oss.adapter;

import com.jc.oss.entity.fileInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.List;

/**
 * @Author gongjiawei
 * @Date 2024/9/4 17:05
 * @注释
 */
public interface StorageAdapter {

    /*创建bucket桶
     * */
    public void createBucket(String bucket);

    /*
     *
     * 上传文件
     *
     */
    public void uploadFile(MultipartFile uploadFile, String bucket, String objectName);
    /*
     * 列出所有桶
     *
     * */
    public List<String> getAllBucket();
    /*
     * 列出当前桶及文件
     *
     * */

    public List<fileInfo> getAllFile(String bucket);


    /*
     * 下载文件
     *
     * */
    public InputStream download(String bucket,String objectName);

    /*
     * 删除桶
     *
     * */
    public void delete(String bucket);
    /*
     * 删除文件
     *
     * */
    public void delete(String bucket,String objectName);


    String getUrl(String bucket, String objectName);

}
